#!/bin/bash
set -euo pipefail

if [[ -f build/FsstWrapper.so ]]; then
    echo "FsstWrapper.so exists, skipping compilation"
    echo "  Remove ./build/FsstWrapper.so to recompile"
    echo "  Remove ./build to reconfigure & compiled"
else
    echo "FsstWrapper.so does not exist, building now"
    mkdir -p build
    cd build
    cmake ../resources
    cmake --build . --config Release
fi
echo "Compilation successful"
